﻿@using EquipmentManager.Entities
@model EquipmentManager.Models.CreateModel<EquipmentBase>

@{
    ViewBag.Title = "Удалить оборудование " + Model.Instance.Name + " в отделении " + Model.Instance.PostOffice.Name;
}

@section menu {
    <section class="featured">
            <div class="master-menu">
                @{Html.RenderPartial("OperatorMenu");}
            </div>
    </section>
}

<h2>Удалить оборудование @Model.Instance.Name в отделении @Model.Instance.PostOffice.Name</h2>

<h3>Вы действительно хотите удалить оборудование @Model.Instance.Name?</h3>

<table class="bordered">
    <tr>
        <td class="vertical-header">Инвентарный номер</td>
        <td>@Html.DisplayFor(model => model.Instance.Number, new { @class = "" })</td>
    </tr>
    <tr>
        <td class="vertical-header">Серийный номер</td>
        <td>@Html.DisplayFor(model => model.Instance.SerialNumber, new { @class = "" })</td>
    </tr>
    <tr>
        <td class="vertical-header">Название</td>
        <td>@Html.DisplayFor(model => model.Instance.Name, new { @class = "" })</td>
    </tr>
    <tr>
        <td class="vertical-header">Описание</td>
        <td><pre>@Html.DisplayFor(model => model.Instance.Description, new { @class = "" })</pre></td>
    </tr>
    <tr>
        <td class="vertical-header">Год</td>
        <td>@Html.DisplayFor(model => model.Instance.Year, new { @class = "" })</td>
    </tr>
    <tr>
        <td class="vertical-header">Рабочее место</td>
        <td>@Html.DisplayFor(model => model.Instance.WorkPlace, new { @class = "" })</td>
    </tr>
    <tr>
        <td class="vertical-header">Состояние</td>
        <td>@Html.DisplayFor(model => model.Instance.State, new SelectList(Enum.GetValues(typeof(State))))</td>
    </tr>
    <tr>
        <td class="vertical-header">Примечание</td>
        <td><pre>@Html.DisplayFor(model => model.Instance.Note, new { @class = "" })</pre></td>
    </tr>
</table>

@using (Html.BeginForm("DeleteEquipment", "Operator", new { @EquipmentId = Model.Instance.Id }, FormMethod.Post))
{
    @Html.HiddenFor(model => model.ParentId)
    
    <p>
        @Html.ActionLink("Отмена", "Equipments", new { @PostOfficeId = Model.ParentId }, new { @class = "common-btn-large BlueColor" }) <input type="submit" value="Удалить" class="common-btn-large RedColor"/>
    </p>
}